<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/3/14
 * Time: 14:10
 */

namespace Home\Controller;


use Think\Controller;

class MatchController extends Controller
{
    public function index(){
        if(IS_POST){
           $Match = D('Match');
           $data = $Match->create();
           if($data){
               $Match->when_long=(strtotime($data['date_e'])-strtotime($data['date_s']))/60;
               if($Match->add()){
                   $this->success("成功");
               }
               else{
                   $this->error("失败");
               }
           }
        }
        $this->display();
    }
}